fix(web): fix KeyboardStub.validateForCustomKeyboard#16067
Conversation
This change fixes a misleading error message in `validateForCustomKeyboard` - `KR` is not the region as the error implies - furthermore it doesn't make sense to check `KR` since it is the optional [keyboard registration function](https://help.keyman.com/developer/engine/web/18.0/reference/interface/registerKeyboard), so this change removes it. Test-bot: skip
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
mcdurdin
left a comment
There was a problem hiding this comment.
LGTM although I hate the way this returns an Error rather than just a boolean. The error message itself undoes the good of having a super function because it includes knowledge of what the super function tests! Error message construction does not belong in the validation function IMO, but in the higher level.
What's more, this is called in just one place in keyboardRequisitioner.ts, but we have two functions, one with an Error message that is never used, just constructed and then thrown away in the subclass. We could (and should) simplify so many of these abstractions and reduce the complexity of KMW.
Weird: keyboardLoaderBase.ts has:
export type KeyboardStub = KeyboardProperties & { filename: string };but KeyboardStub is defined in keyboardStub.ts:
export class KeyboardStub extends KeyboardPropertiesAnd we have RawKeyboardStub vs KeyboardStub:
export interface RawKeyboardStub extends KeyboardStub {};I don't understand why all these are necessary!
This change fixes a misleading error message in
validateForCustomKeyboard-KRis not the region as the error implies - furthermore it doesn't make sense to checkKRsince it is the optional keyboard registration function, so this change removes it.Test-bot: skip